<!--style>
#frm_popup_verPem{
	margin-left:10px;
	font-size:10px;
	text-decoration:underline;
	color:#0033FF;
	cursor:pointer;
}
</style-->
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/js/numerik.js"></script>
<script type="text/javascript">


    $(document).ready(function(){
        
        $("#Setoran_tgl_bayar").blur(function(){
            $("#Setoran_no_rev").val($("input[name=hidden_ref]").val()); 
        });

        $("#id").autoNumeric({aSep: '.', aDec: ','});

    
        $("#btn_pilih_NOP").click(function(){
            
            $("#dialog-objek").dialog('open');
        });
        
        $("#btn_pilih_kbt").click(function(){
            
            $("#dialog-kbt").dialog('open');
        });

        $("#nop1").keyup(function(e){
    if (e.keyCode == '113'){
    $("#dialog-objek").dialog("open");
    }		
    });
        $("#subjek_pajak_id").keyup(function(e){
    if (e.keyCode == '114'){
    $("#dialog-nik").dialog('open');
    }		
    });

        $("#btn_pilih_Nik").click(function(){
            $("#dialog-nik").dialog('open');
        });


        $("#hideJenisSK").change(function(){
            //            $("#dialog-objek").dialog('open');
            
            //var a = window.location.href;
            
            //var b = $(location).attr('href').replace($(location).attr('pathname'),'');
            
            //alert(b);
            //exit;
            
            if($(this).val()=='01'){
               $("#frm_popup_verPem").show();
               $("#ui-id-3").text('Data SPTPD')
                
            }
            else if($(this).val()=='02'){
                $("#ui-id-3").text('Data SKPDKB')
                
            }
            else if($(this).val()=='03'){
                $("#ui-id-3").text('Data SKPDKBT')
                
            }
            else if($(this).val()=='04'){
                $("#ui-id-3").text('Data SKPDLB')
                
            }
            else if($(this).val()=='05'){
                $("#ui-id-3").text('Data SKPDN')
                
            }
            
            
            
            if($(this).val()!='01'){
              $("#frm_popup_verPem").hide();

			 $( "#popUp" ).load( "<?php echo Yii::app()->createUrl('/Pembayaran/PembayaranSetoranBank/PopUp') ?>",{id:$(this).val()}); 
                                                       
                $("#coba").show();
                $("#btn_pilih_NOP").hide();
                $("#btn_pilih_Nik").hide();
               $("#no_form").attr("readonly",true);
               $("#no_reg").attr("readonly",true);
               $("#nop").attr("readonly",true);
               $("#nama_pemilik").attr("readonly",true);
               $("#jalan_op").attr("readonly",true);
               $("#blok_kav_no_op2").attr("readonly",true);
               $("#blok_kav_no_op").attr("readonly",true);
               $("#subjek_pajak_id").attr("readonly",true);
               $("#nm_wp").attr("readonly",true);
               $("#jalan_wp").attr("readonly",true);
               $("#blok_kav_no_wp").attr("readonly",true);
               $("#nama_kec").attr("readonly",true);
               $("#kelurahan_wp").attr("readonly",true);
               $("#rt_wp").attr("readonly",true);
               $("#rw_wp").attr("readonly",true);
               $("#kd_pos_wp").attr("readonly",true);
               $("#kota_wp").attr("readonly",true);
               $("#tot_pajak").attr("readonly",true);
            }else{
                   //alert('berubahs');
                //alert($(this).val());
                $("#coba").hide();
                $("#btn_pilih_NOP").show();
                $("#btn_pilih_Nik").show();
                $("#nama_pemilik").removeAttr("disabled");
                $("#no_form").removeAttr("disabled");
                $("#no_reg").removeAttr("disabled");
               $("#nop").removeAttr("disabled");
                $("#blok_kav_no_op2").removeAttr("disabled");
               $("#nama_pemilik").removeAttr("disabled");
               $("#jalan_op").removeAttr("disabled");
               $("#blok_kav_no_op").removeAttr("disabled");
               $("#subjek_pajak_id").removeAttr("disabled");
               $("#nm_wp").removeAttr("disabled");
               $("#jalan_wp").removeAttr("disabled");
               $("#blok_kav_no_wp").removeAttr("disabled");
               $("#nama_kec").removeAttr("disabled");
               $("#kelurahan_wp").removeAttr("disabled");
               $("#rt_wp").removeAttr("disabled");
               $("#rw_wp").removeAttr("disabled");
               $("#kd_pos_wp").removeAttr("disabled");
               $("#kota_wp").removeAttr("disabled");
               $("#tot_pajak").removeAttr("disabled");
            }
            
        });
		
		$("#frm_popup_verPem").click(function(){
			if($("#nop1").val() == "" || $("#nop2").val() == "" || $("#nop3").val() == "" || $("#nop4").val() == "" || $("#nop5").val() == "" || $("#nop6").val() == "" || $("#nop7").val() == "")
				alert("Nomor Objek Pajak (NOP) masih kosong! ");
			else{
				var nop = $("#nop1").val()+$("#nop2").val()+$("#nop3").val()+$("#nop4").val()+$("#nop5").val()+$("#nop6").val()+$("#nop7").val();
				$("#popup_verPem").load("<?php echo Yii::app()->createUrl('/Pembayaran/PembayaranSetoranBank/verifikasi') ?>",{nop:nop});
				$("#dialog-verPem").dialog('open');
			}
		});
    });

    
    function PilihKb(bb){
        var cc=bb.split("#");
        
        $("#no_form").val(cc[0]);
        $("#no_reg").val(cc[1]);
        $("#nop").val(cc[2]);
        $("#nama_pemilik").val(cc[3]);
        $("#jalan_op").val(cc[4]);
        $("#blok_kav_no_op").val(cc[5]);
        $("#subjek_pajak_id").val(cc[6]);
        $("#nm_wp").val(cc[7]);
        $("#jalan_wp").val(cc[8]);
        $("#blok_kav_no_wp").val(cc[9]);
        $("#nama_kec").val(cc[10]);
        $("#kelurahan_wp").val(cc[11]);
        $("#rt_wp").val(cc[12]);
        $("#rw_wp").val(cc[13]);
        $("#kd_pos_wp").val(cc[14]);
        $("#kota_wp").val(cc[15]);
        $("#tot_pajak").val(cc[16]);
        $("#kode_sptpd").val(cc[17]);
        
        var nop1=cc[2].substring(0,2);
        var nop2=cc[2].substring(2,4);
        var nop3=cc[2].substring(4,7);
        var nop4=cc[2].substring(7,10);
        var nop5=cc[2].substring(10,13);
        var nop6=cc[2].substring(13,17);
        var nop7=cc[2].substring(17,18);
        
        $("#nop1").val(nop1);
        $("#nop2").val(nop2);
        $("#nop3").val(nop3);
        $("#nop4").val(nop4);
        $("#nop5").val(nop5);
        $("#nop6").val(nop6);
        $("#nop7").val(nop7);
        

        $("#dialog-kbt").dialog('close');						


    }
    


    function PilihNop(aa){
        //alert('x'+nama_pmk+'x');
        
        var cc=aa.split("#");
        
        $("#nop").val(cc[0]);
        $("#nama_pemilik").val(cc[1]);
        $("#jalan_op").val(cc[2]);
        $("#blok_kav_no_op2").val(cc[3]);
       
        var nop1=cc[0].substring(0,2);
        var nop2=cc[0].substring(2,4);
        var nop3=cc[0].substring(4,7);
        var nop4=cc[0].substring(7,10);
        var nop5=cc[0].substring(10,13);
        var nop6=cc[0].substring(13,17);
        var nop7=cc[0].substring(17,18);
        
        $("#nop1").val(nop1);
        $("#nop2").val(nop2);
        $("#nop3").val(nop3);
        $("#nop4").val(nop4);
        $("#nop5").val(nop5);
        $("#nop6").val(nop6);
        $("#nop7").val(nop7);
        

        $("#dialog-objek").dialog('close');						


    }

    function PilihNik(aa){
        
        var cc=aa.split("#");
        
        $("#subjek_pajak_id").val(cc[0]);
        $("#nm_wp").val(cc[1]);
        $("#jalan_wp").val(cc[2]);
        $("#blok_kav_no_op").val(cc[3]);
        $("#kelurahan_wp").val(cc[4]);
        $("#rt_wp").val(cc[5]);
        $("#rw_wp").val(cc[6]);
        $("#nama_kec").val(cc[7]);
        $("#kd_pos_wp").val(cc[8]);
        $("#kabupaten").val(cc[9]);
       
        $("#dialog-nik").dialog('close');						


    }
    
    function movetoNext(current, nextFieldID) {
        if (current.value.length >= current.maxLength) {
            document.getElementById(nextFieldID).focus();
        }
    }


</script>

<?php
	if(Yii::app()->user->hasFlash('success'))
		$this->widget('bootstrap.widgets.TbAlert', array());

$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
    'id' => 'horizontalForm',
    'type' => 'horizontal',
    'enableAjaxValidation' => false,
        ));
?>

<div class="form">
    <!--br-->
    <!--fieldset-->
	
	<?php echo $form->errorSummary($model); ?>
	<?php echo $form->errorSummary($modelWajibPajak); ?>
	<?php echo $form->errorSummary($modelDatSubjekPajak); ?>
	<?php echo $form->errorSummary($modelSetoran); ?>

	<div class="control-group ">
		<label class="control-label" >Tahun</label>
		<div class="controls">
			<?php echo $form->textField($modelSetoran, 'thn_pajak', array('class' => 'span2', 'value' => date('Y'), 'maxlength' => 35)); ?>
			<?php //echo $form->hiddenField($modelSetoran, 'kode_vib', array('type' => "hidden", 'class' => 'span2', 'value' => '1')); ?>
		</div>
	</div>

	<div class="control-group ">
		<label class="control-label" >Jenis SK</label>
		<div class="controls">
			<?php echo $form->DropDownList($modelSetoran, 'jenis_sk', CHtml::listData(Sk::model()->findAll('1=1 order by kode_sk asc'), 'kode_sk', 'nama_sk'), array('class' => 'span2','id'=>'hideJenisSK')); ?>
		</div>
	</div>

	<div class="control-group " id="coba" style="display:none;">
		<label class="control-label" >Nomor SSPD</label>
		<div class="controls">
			<div class="span2" style="margin-left:0;">
				<div class="input-group">
				<input type="text" class="form-control" id="no_form">
				<span class="input-group-btn">	
				<?php
				$this->widget('bootstrap.widgets.TbButton', array(                    
					'type' => 'info',
					'label' => 'F1',
					'htmlOptions' => array(
						'id' => 'btn_pilih_kbt',
						//'style' => 'margin-top:-5px;',
					),
				));
				?>
				</span>
				</div>
			</div>
			<label class="control-label">No Register</label>
			<input type="text" class="span2" id="no_reg">
		</div>
	</div>

	<div class="control-group" >
		<label class="control-label" for="TestForm_textField">NOP PBB </label>
		<div class="controls">
			<?php echo $form->textField($modelSetoran, 'kd_propinsi', array('class' => 'span1', 'id' => 'nop1','readonly'=>true, 'maxlength' => 2)); ?>
			-
			<?php echo $form->textField($modelSetoran, 'kd_dati2', array('class' => 'span1', 'id' => 'nop2','readonly'=>true, 'maxlength' => 2)); ?>
			-
			<?php echo $form->textField($modelSetoran, 'kd_kecamatan', array('class' => 'span1', 'id' => 'nop3','readonly'=>true, 'maxlength' => 3)); ?>
			-

			<?php echo $form->textField($modelSetoran, 'kd_kelurahan', array('class' => 'span1', 'id' => 'nop4','readonly'=>true, 'maxlength' => 3)); ?>
			-
			<?php echo $form->textField($modelSetoran, 'kd_blok', array('class' => 'span1', 'id' => 'nop5','readonly'=>true, 'maxlength' => 3)); ?>
			-
			<?php echo $form->textField($modelSetoran, 'no_urut', array('class' => 'span1', 'id' => 'nop6','readonly'=>true, 'maxlength' => 3)); ?>
			-
			<?php echo $form->textField($modelSetoran, 'kd_jns_op', array('class' => 'span1', 'id' => 'nop7','readonly'=>true, 'maxlength' => 3)); ?>
			<?php
			$this->widget('bootstrap.widgets.TbButton', array(                    
				'type' => 'info',
				'label' => 'F2',
				'htmlOptions'=>array(
					'id'=>'btn_pilih_NOP',
					'style'=>'margin-top:-5px;',
				)
			));
			?>
		</div>
	</div>

	<div class="control-group ">
		<label class="control-label" >Nama Pemilik </label>
		<div class="controls">
			<input type="text" class="span4" id="nama_pemilik" readonly>
	   </div>
	</div>


	<div class="control-group ">
		<label class="control-label" > Jalan Pemilik </label>
		<div class="controls">
			<input type="text" class="span4" id="jalan_op" readonly>
			<?php //echo $form->textField($modelWajibPajak, 'alamat_wp', array('class' => 'span4', 'maxlength' => 50)); ?>

			<label class="control-label" style="width:130px;">Blok/Kav/No Pemilik</label>
			<input type="text" class="span2" id="blok_kav_no_op2" readonly>
		</div>
	</div>

	<div class="control-group ">
		<label class="control-label" >NIK [KTP]</label>
		<div class="controls">
			<div class="span4" style="margin-left:0;">
				<div class="input-group">
				<?php echo $form->textField($modelSetoran, 'nik_wp', array('class' => 'form-control', 'id' => 'subjek_pajak_id', 'maxlength' => 50)); ?>
				<span class="input-group-btn">	
					<?php
					$this->widget('bootstrap.widgets.TbButton', array(
						'type' => 'info',
						'label' => 'F3',
						'htmlOptions'=>array(
							'id'=>'btn_pilih_Nik',
						)
					));
					?>
				</span>
				</div>
			</div>
		</div>
	</div>

	<div class="control-group ">
		<label class="control-label" ><b>Nama Wajib Pajak</b></label>
		<div class="controls">
			<?php echo $form->textField($modelDatSubjekPajak, 'nm_wp', array('class' => 'span3','id'=>'nm_wp')); ?>
		</div>
	</div>

	<div class="control-group ">
		<label class="control-label" > Jalan </label>
		<div class="controls">                
			<?php echo $form->textField($modelDatSubjekPajak, 'jalan_wp', array('class' => 'span4','id'=>'jalan_wp', 'maxlength' => 50)); ?>

			<label class="control-label">Blok/Kav/No</label>
			<?php echo $form->textField($modelDatSubjekPajak, 'blok_kav_no_wp', array('class' => 'span2','id'=>'blok_kav_no_op', 'maxlength' => 50)); ?>

		</div>
	</div>
	
	<div class="control-group ">
		<label class="control-label" >Kecamatan </label>
		<div class="controls">
			<?php echo $form->textField($modelWajibPajak, 'nama_kec', array('class' => 'span3','id'=>'nama_kec', 'maxlength' => 25)); ?>
			
			<label class="control-label" style="width:120px;">Kelurahan/Desa</label>
			<?php echo $form->textField($modelDatSubjekPajak, 'kelurahan_wp', array('class' => 'span3','id'=>'kelurahan_wp', 'maxlength' => 25)); ?>
		</div>
	</div>

	<div class="control-group ">
		<label class="control-label" >RT </label>
		<div class="controls">
			<?php echo $form->textField($modelDatSubjekPajak, 'rt_wp', array('class' => 'span1','id'=>'rt_wp', 'maxlength' => 4)); ?>
			
			<label class="control-label" style="width:30px;">RW</label> 
			<?php echo $form->textField($modelDatSubjekPajak, 'rw_wp', array('class' => 'span1','id'=>'rw_wp', 'maxlength' => 4)); ?>

			<label class="control-label">Kode Pos</label>
			<?php echo $form->textField($modelDatSubjekPajak, 'kd_pos_wp', array('class' => 'span2','id'=>'kd_pos_wp', 'maxlength' => 25)); ?>
		</div>
	</div>
		
	<div class="control-group ">
		<label class="control-label" >Kabupaten/Kota </label>
		<div class="controls">
			<?php echo $form->textField($modelDatSubjekPajak, 'kota_wp', array('class' => 'span3','id'=>'kabupaten', 'maxlength' => 35)); ?>
		</div>
	</div>

	<div class="control-group ">
		<label class="control-label" >Tanggal Bayar</label>
		<div class="controls">
			<div class="span2" style="margin:0;">
				<div class="input-group">
				<span class="input-group-addon"><i class="icon-calendar"></i></span>
				<?php
				$this->widget('zii.widgets.jui.CJuiDatePicker', array(
					'model' => $modelSetoran,
					'attribute' => 'tgl_bayar',
					// additional javascript options for the date picker plugin
					'options' => array(
						'yearRange' => 'c-50:c+20',
					),
				));
				?>
				</div>
			</div>
		</div>
	</div>

	<div class="control-group ">
		<label class="control-label" ><b> No Pembayaran </b> </label>
		<div class="controls">

			<?php
			$query = " SELECT MAX(bayar) as jumlah FROM bphtb.nomor_sk";
			$hasil = Yii::app()->db->createCommand($query)->queryRow();
			$maxBayar = $hasil['jumlah']+1;
			
			
			$ad = "SELECT COUNT(*) as nomor FROM  bphtb.setoran";
			$jml = Yii::app()->db->createCommand($ad)->queryRow();
			$as = $jml['nomor'] + 1;

			if ($count < 10) {
				$valRef='B/00000' . $maxBayar . '/' . date('Y') . '-' . $as;
				
			} else if ($count < 100) {
				$valRef= 'B/0000' . $maxBayar . '/' . date('Y') . '-' . $as;
					
			} else if ($count < 1000) {
			   $valRef= 'B/000' . $maxBayar . '/' . date('Y') . '-' . $as;
			} else {
				$valRef='B/00' . $maxBayar . '/' . date('Y') . '-' . $as;
			}
		  echo $form->textField($modelSetoran, 'no_rev', array('class' => 'span3','readonly'=>true ,'maxlength' => 20));
		  
		  echo '<input type="hidden" value='.$valRef.'  name="hidden_ref">';
		  
			?>
		</div>
	</div>

    <div class="control-group">
		<label class="control-label" >Yang Harus diBayar</label>
		<div class="controls">
			<div class="span3" style="margin:0;">
				<div class="input-group">
				<span class="input-group-addon">Rp.</span>
				<input type="text" class="form-control" id="tot_pajak" readonly="readonly" />
				<span class="input-group-addon"><span style="padding-left:8px;">,00</span></span>
				</div>
			</div>
            <!--span id="frm_popup_verPem">Verifikasi</span-->
			<?php
			$this->widget('bootstrap.widgets.TbButton', array(
				'buttonType' => 'link',
				'type' => 'info',
				'icon' => 'circle-blank',
				'label' => 'Verifikasi',
				'htmlOptions' => array(
					'id' => 'frm_popup_verPem',
					'style' => 'margin-left:10px',
			  ),
			));
			?>
		</div>
        <div class="controls">
			<div class="span3">
				<?php echo $form->hiddenField($modelSetoran, 'kode_sptpd', array('class' => 'span1','readonly'=>true,'id'=>'kode_sptpd','type'=>"hidden" )); ?>                
			</div>
		</div>
	</div>
        
	<div class="control-group ">
		<label class="control-label">Jumlah Bayar</label>
		<div class="controls">
			<div class="span3" style="margin:0;">
			<div class="input-group">
				<span class="input-group-addon">Rp.</span>
				<?php echo $form->textField($modelSetoran, 'jml_bayar', array('class' => 'form-control', 'id' => 'id', 'maxlength' => 35)); ?>
				<span class="input-group-addon"><span style="padding-left:8px;">.00</span></span>
			</div>
			</div>
		</div>
	</div>

	<div class="form-actions">
		<?php
		$this->widget('bootstrap.widgets.TbButton', array(
			'buttonType' => 'submit',
			//'type' => 'primary',
			'type' => 'success',
			'icon' => 'save',
			'label' => $modelSetoran->isNewRecord ? 'Simpan' : 'update',
		));
		?>
		<?php
		$this->widget('bootstrap.widgets.TbButton', array(
			//'buttonType' => 'submit',
			'type' => 'primary',
			'icon' => 'search',
			'label' => 'Cari',
			'url' => Yii::app()->createUrl('/Pembayaran/PembayaranSetoranBank/admin'),
			'htmlOptions' => array(
				'style' => 'margin-left:5px;',
			),
		));
		?>
		<?php
		$this->widget('bootstrap.widgets.TbButton', array(
			'buttonType' => 'reset',
			//'type' => 'primary',
			'icon' => 'remove',
			'htmlOptions' => array(
				//'class' => 'btn-default',
				'style' => 'margin-left:5px;',
			),
			'label' => $model->isNewRecord ? 'Batal' : 'Batal',
		));
		?>
	</div>

<?php $this->endWidget(); ?>
    <!--/fieldset-->

    <?php
    $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
        'id' => 'dialog-objek',
        'options' => array(
            'title' => 'Data Objek Pajak',
			'overflow'=>'scroll',
            'width' => 900,
            'height' => 600,
            //'autoOpen' => false,
            //'buttons' => array(
            //    'Ok' => 'js:function(){$(this).dialog("close")}',),
        ),
    ));
    ?>

    
<?php

Yii::app()->clientScript->registerScript('searchInfoNOP', "
    $('form#search').submit(function(){
    	$.fn.yiiGridView.update('op-grid', {
    		data: $(this).serialize()
    	});
    	return false;
    });
");

$form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'action'=>Yii::app()->createUrl($this->route),
	'method'=>'get',
	'id'=>'search',
	'type'=>'horizontal',
)); 
?>

<div class="alert alert-info">
<div class="form">
<div class="control-group yangdicopy">
	<label class="control-label">Kecamatan</label>
	<div class="controls">
	 <?php
	 echo CHtml::dropDownList('ObjekPajak[kd_kecamatan]','',
			 CHtml::listData(RefKecamatan::model()->findAll(), 'kd_kecamatan', 'nm_kecamatan'),
			array(
				'onChange' => CHtml::ajax(array(
					'type' => 'POST',
					'dataProvider' => $model->CariObjekPajak(),
					//'filter' => $modelRefKecamatan,
					'dataType' => 'json',
					'url' => array('PembayaranSetoranBank/Loadcities'),  //action yang dipanggil pada perintah AJAX
					'data' => "js:{haha:$(this).val(), idnya:$(this).attr('id')}",  //memberikan nilai provinsi yang dikirim dan mengirim row yang ke berapa yang sedang digunakan
					'success' => "function(data){
					var x='';
					var y='';
					for(var i=0;i<data.length;i++){
					  y=data[i].split('-');
					  
						x+='<option value=\''+y[0]+'\'>'+y[1]+'</option>'
					}
					
				   var kabu='#kelurahan'+data.idnya;   //mendefinisikan row kabupaten mana yang akan di edit. Ini kita definisikan sendiri dengan algoritma yang kita buat
				   $('#ObjekPajak_kd_kelurahan').html(x);  // menginput daftar kabupaten pada row kabupaten yang terpilih
				 }",
				)), 'empty' => 'Pilih Provinsi',
	));
	?>
	</div>
<!--br-->
	<label class="control-label">Kelurahan</label>
	<div class="controls">
	<?php 
	echo CHtml::dropDownList('ObjekPajak[kd_kelurahan]','',
				 array(),array(
					 'empty'=>'Pilih Kelurahan')); 
	 ?>
	</div>
<!--br /-->
	<label class="control-label">Nama Pemilik</label>
	<div class="controls">
		<input type="text" name="ObjekPajak[nm_wp]" id="ObjekPajak_nm_wp" />
	</div>
	
	<!--button type="submit" id="btn-sbmt" name="btn-sbmt" class="btn btn-primary">Cari</button-->
	
	<?php
	$this->widget('bootstrap.widgets.TbButton', array(
		'buttonType' => 'submit',
		//'type' => 'primary',
		'icon' => 'search',
		'htmlOptions' => array(
			'style' => 'margin-left:20px;',
		),
		'label' => 'Cari',
	));
	?>
</div>
</div>
</div>
           
<?php $this->endWidget(); ?>
    
    <?php
    $this->widget('bootstrap.widgets.TbGridView', array(
        'id' => 'op-grid',
        'dataProvider' => $model->CariObjekPajak(),
        'type' => 'striped bordered condensed',        
		'pager' => array(
			'header' => '',
			'cssFile' => false,
			'selectedPageCssClass' => 'active',
			'hiddenPageCssClass' => 'disabled',
			'firstPageCssClass' => 'previous',
			'lastPageCssClass' => 'next',
			'firstPageLabel' => 'First',
			'lastPageLabel' => 'Last',
			'prevPageLabel' => 'Prev',
			'nextPageLabel' => 'Next',
		),
        'columns' => array(
            array(
                'name' => 'nop',
                'value' => '$data->nop',
            ),
            array(
                'name' => 'nama_pemilik',
                'value' => '$data->nama_pemilik',
            ),
            array(
                'name' => 'jalan_op',
                'value' => '$data->jalan_op',
            ),
            
            array(
                'value' => 'CHtml::Button("Pilih",
                array("onClick" => "PilihNop(\'".$data->nop."#".
                str_replace(array("\'"), array(""), $data->nama_pemilik)."#".
                $data->jalan_op."#".                                 
                $data->blok_kav_no_op."\'
                )",
				"class"=>"btn btn-info",
				))',
                'type' => 'raw',
				'htmlOptions'=>array(
					'style'=>'text-align:center',
				),
            ),
        ),
    ));
    ?>

    <?php
    $this->endWidget('zii.widgets.jui.CJuiDialog');
    ?>


    <?php
    $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
        'id' => 'dialog-nik',
        'options' => array(
            'title' => 'Data NIK',
            'width' => 1000,
            'height' => 600,
            //'autoOpen' => false,
            'modal'=>true
            //'buttons' => array(
            //    'Ok' => 'js:function(){$(this).dialog("close")}',),
        ),
    ));
    ?>
<?php 
		Yii::app()->clientScript->registerScript('searchNik', "
			$('form#search_nik').submit(function(){
				$.fn.yiiGridView.update('NIK', {
					data: $(this).serialize()
				});
				return false;
			});
		
		");
		$form1 = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
			'action'=>Yii::app()->createUrl($this->route),
			'method'=>'get',
			'id'=>'search_nik',
			'type'=>'horizontal',
    	));

?>
        <div class="alert alert-info">
			<div class="control-group">
				<label class="control-label">NIK </label>
				<div class="controls">
					<input type="text" class="span3" name="DatSubjekPajak[subjek_pajak_id]" id="DatSubjekPajak_Nik" /> 
                </div>
			</div>
			
			<div class="control-group">
				<label class="control-label">Nama Wajib Pajak </label>
				<div class="controls">    
					<input type="text" class="span3" name="DatSubjekPajak[nm_wp]" id="DatSubjekPajak_Nm_wp" />
			<!--button class="btn btn-primary" id="btn_search" type="submit" name="btn_search">Cari</button-->
				</div>
			</div>
				
			<div class="control-group">
				<!--div class="controls"-->
				<?php
				$this->widget('bootstrap.widgets.TbButton', array(
					'buttonType' => 'submit',
					//'type' => 'primary',
					'icon' => 'search',
					'htmlOptions' => array(
						'id' => 'btn_search',
						'style' => 'margin-left:20px;',
					),
					'label' => 'Cari',
				));
				?>
				<!--/div-->
			</div>
        </div>
		
		<?php $this->endWidget(); ?>
            
    
    <?php
    $this->widget('bootstrap.widgets.TbGridView', array(
        'id' => 'NIK',
        'dataProvider' => $modelDatSubjekPajak->searchNik(),
        'type' => 'striped bordered condensed',
		'pager' => array(
			'header' => '',
			'cssFile' => false,
			'selectedPageCssClass' => 'active',
			'hiddenPageCssClass' => 'disabled',
			'firstPageCssClass' => 'previous',
			'lastPageCssClass' => 'next',
			'firstPageLabel' => 'First',
			'lastPageLabel' => 'Last',
			'prevPageLabel' => 'Prev',
			'nextPageLabel' => 'Next',
		),
        'columns' => array(
            array(
                'header' => 'Subjek Pajak ID',
                'value' => '$data->subjek_pajak_id',
            ),
            array(
                'header' => 'Nama Wajib Pajak',
                'value' => '$data->nm_wp',
            ),
            array(
                'header' => 'Jalan Wajib Pajak',
                'value' => '$data->jalan_wp',
            ),
            array(
                'header' => 'Kelurahan',
                'value' => '$data->kelurahan_wp',
            ),
            array(
                'header' => 'Kabupaten',
                'value' => '$data->kabupaten',
            ),
            array(
                'header' => 'Nama Kecamatan',
                'value' => '$data->nama_kec',
            ),
		array(
            'value' => 'CHtml::Button("Pilih",
                array("onClick" => "PilihNik(\'".$data->subjek_pajak_id."#".
                $data->nm_wp."#".
                $data->jalan_wp."#".
                $data->blok_kav_no_wp."#".
                str_replace(array("\'"), array(""), $data->kelurahan_wp)."#".
                $data->rt_wp."#".
                $data->rw_wp."#".
                $data->nama_kec."#".
                $data->kd_pos_wp."#".
                $data->kabupaten."\'
                )",
				"class"=>"btn btn-info",
				))',
            'type' => 'raw',
			'htmlOptions'=>array(
				'style'=>'text-align:center',
			),
        ),
        ),
    ));
    ?>
    
	<?php
    $this->endWidget('zii.widgets.jui.CJuiDialog');
    ?>
	
    <?php
    $this->beginWidget('zii.widgets.jui.CJuiDialog', array(
        'id' => 'dialog-kbt',
        'options' => array(
            'title' => 'Data KBT',
            'width' => 900,
            'height' => 600,
            //'autoOpen' => false,
            'modal'=>true
            //'buttons' => array(
            //    'Ok' => 'js:function(){$(this).dialog("close")}',),
        ),
    ));
    ?>
    
	<div id="popUp" >
			
			
	</div>
	
	<?php $this->endWidget('zii.widgets.jui.CJuiDialog');   ?>    

    <?php
		$this->beginWidget('zii.widgets.jui.CJuiDialog', array(
			'id' => 'dialog-verPem',
			'options' => array(
				'title' => 'Verifikasi Pembayaran',
				'width' => 800,
				'height' => 600,
			),
		));
    ?>
	<div id="popup_verPem"></div>
	<?php $this->endWidget('zii.widgets.jui.CJuiDialog');   ?>    

</div>